<div id="news_hilight">
	<?php if(!empty($dataNewsHilight)) foreach($dataNewsHilight as $key => $value):?>
	<div class="hilight_id_<?php echo $value->news_id;?>" <?php echo ($key==0 ? '':'style="display:none;"');?>>
		<a href="<?php echo base_url();?>archives/<?php echo $value->news_id.'-'.seo_url($value->news_subject);?>" target="_blank">
			<div class="image">
				<?php echo exec_image(array(
					'folder' => 'news',
					'dimension' => '650x320',
					'file_name' => @$value->image->news_file_name.'.'.@$value->image->news_file_ext,
					'alt' => ''.$value->news_subject.'',	
					'title' => ''.$value->news_subject.''	
					)
				);?>	
			</div>
		</a>
		<div class="info">
			<div class="fixHeight">
				<a href="<?php echo base_url();?>archives/<?php echo $value->news_id.'-'.seo_url($value->news_subject);?>" target="_blank"><h2><?php echo $value->news_subject;?></h2></a>
				<p><?php echo $value->news_brief;?></p>
			</div>
			<div class="post">
				วันที่ <?php echo date('d/m/Y',strtotime($value->news_publish_date));?><span class="grayLight"> l </span>ดู <?php echo number_format($value->views);?> ครั้ง
			</div>
		</div>
	</div>
	<?php endforeach;?>
	<ul>
		<?php if(!empty($dataNewsHilight)) foreach($dataNewsHilight as $key => $value):?>
		<li>
			<a href="javascript:void(0);" onclick="javascript:swapHilight(this);" class="hilight_id_<?php echo $value->news_id;?>" <?php echo ($key==0 ? 'style="display:none;"':'');?>>
				<div class="image">
					<?php echo exec_image(array(
							'folder'   => 'news',
							'dimension'=> '85x50',
							'file_name'=> @$value->image->news_file_name.'.'.@$value->image->news_file_ext,
							'alt'      => ''.$value->news_subject.'',
							'title'    => ''.$value->news_subject.''
						)
					);?>
				</div>
			</a>
		</li>
		<?php endforeach;?>
	</ul>				
</div> 
<div id="left_side">
	<div id="news">
		<!--ข่าวล่าสุด-->
		<div class="header"><span>ข่าวบันเทิงล่าสุด</span></div>
		<div id="ajax_pager"><?php echo $dataNewsUpdate;?></div>
		<!--บทความ-->
		<?php if(!empty($dataNewsArticle)):?>
		<br />
		<div class="header"><span>บทความ</span></div>
		<ul class="news_block_style1">
			<li>
				<a href="<?php echo base_url();?>archives/<?php echo $dataNewsArticle->news_id.'-'.seo_url($dataNewsArticle->news_subject);?>" target="_blank">
					<div class="image">
						<?php echo exec_image(array(
							'folder' => 'news',
							'dimension' => '315x190',
							'file_name' => @$dataNewsArticle->image->news_file_name.'.'.@$dataNewsArticle->image->news_file_ext,
							'alt' => ''.$dataNewsArticle->news_subject.'',	
							'title' => ''.$dataNewsArticle->news_subject.''	
							)
						);?>					
					</div>
				</a>
				<div class="info">
					<div class="fixHeight">
						<a href="<?php echo base_url();?>archives/<?php echo $dataNewsArticle->news_id.'-'.seo_url($dataNewsArticle->news_subject);?>" target="_blank"><h3><?php echo $dataNewsArticle->news_subject;?></h3></a>
						<p><?php echo $dataNewsArticle->news_brief;?></p>
					</div>
					<span class="post">
						<?php echo date('d.m.Y',strtotime($dataNewsArticle->news_publish_date));?><span class="grayLight"> l </span><?php echo number_format($dataNewsArticle->views);?> VIEWS
						<a href="<?php echo base_url().'article';?>" class="readMoreNews"><div>อ่านบทความทั้งหมด</div></a>
					</span>
				</div>	
			</li>	
		</ul>
		<?php endif;?>
		<!--อัลบั้มรีวิว-->
		<?php if(!empty($dataNewsAlbumReview)):?>
		<br />
		<div class="news_block_style2">
			<div class="header">
				<span>อัลบั้มรีวิว</span>
				<a href="<?php echo base_url().'review';?>" target="_blank">ดูทั้งหมด</a>
			</div>
			<div class="cycleElementsContainer" id="slider">
				<div class="slider">
					<ul>
						<?php foreach($dataNewsAlbumReview as $key => $value):?>
						<li>
							<div class="image">
								<?php echo exec_image(array(
										'folder' => 'news',
										'dimension' => '140x140',
										'file_name' => @$value->image->news_file_name.'.'.@$value->image->news_file_ext,
										'alt' => ''.@$value->news_subject.'',	
										'title' => ''.@$value->news_subject.''	
									)
								);?>
							</div>
							<div class="frame"></div>							
							<a href="<?php echo base_url().'archives/'.$value->news_id.'-'.seo_url($value->news_subject);?>" target="_blank">
								<?php echo $value->news_subject;?>
							</a>
						</li>				
						<?php endforeach;?>
					</ul>
				</div>
				<div class="navigation">
					<a href="#" class="cycleToPoint red active" data-position="1"></a> 
					<a href="#" class="cycleToPoint red" data-position="5"></a> 
					<a href="#" class="cycleToPoint red" data-position="9"></a> 
					<a href="#" class="cycleToPoint red" data-position="13"></a> 
					<a href="#" class="cycleToPoint red" data-position="17"></a>
				</div>
			</div>
		</div>
		<?php endif;?>
		<!--ข่าวไทย-->
		<?php if(!empty($dataNewsThai)):?>
		<br />
		<div class="news_block_style3 floatLeft">
			<div class="header"><span>ข่าวไทย</span></div>
			<a href="<?php echo base_url().'archives/'.$dataNewsThai->news_id.'-'.seo_url($dataNewsThai->news_subject);?>" target="_blank">
				<h2><?php echo $dataNewsThai->news_subject;?></h2>
				<div class="image">
					<?php echo exec_image(array(
							'folder' => 'news',
							'dimension' => '315x190',
							'file_name' => @$dataNewsThai->image->news_file_name.'.'.@$dataNewsThai->image->news_file_ext,
							'alt' => ''.@$dataNewsThai->news_subject.'',	
							'title' => ''.@$dataNewsThai->news_subject.''	
						)
					);?>			
				</div>
			</a>
			<p><?php echo $dataNewsThai->news_brief;?></p>
			<span class="post">
				<?php echo date('d.m.Y',strtotime($dataNewsThai->news_publish_date));?><span class="grayLight"> l </span><?php echo number_format($dataNewsThai->views);?> VIEWS
				<a href="<?php echo base_url().'thai';?>" class="readMoreNews"><div>อ่านข่าวทั้งหมด</div></a>
			</span>
		</div>
		<?php endif;?>
		<!--ข่าวต่างประเทศ-->
		<?php if(!empty($dataNewsInter)):?>
		<div class="news_block_style3 floatRight">
			<div class="header"><span>ข่าวต่างประเทศ</span></div>
			<a href="<?php echo base_url().'archives/'.$dataNewsInter->news_id.'-'.seo_url($dataNewsInter->news_subject);?>" target="_blank">
				<h2><?php echo $dataNewsInter->news_subject;?></h2>
				<div class="image">
					<?php echo exec_image(array(
							'folder' => 'news',
							'dimension' => '315x190',
							'file_name' => @$dataNewsInter->image->news_file_name.'.'.@$dataNewsInter->image->news_file_ext,
							'alt' => ''.@$dataNewsInter->news_subject.'',	
							'title' => ''.@$dataNewsInter->news_subject.''	
						)
					);?>			
				</div>
			</a>
			<p><?php echo $dataNewsInter->news_brief;?></p>
			<span class="post">
				<?php echo date('d.m.Y',strtotime($dataNewsInter->news_publish_date));?><span class="grayLight"> l </span><?php echo number_format($dataNewsInter->views);?> VIEWS
				<a href="<?php echo base_url().'inter';?>" class="readMoreNews"><div>อ่านข่าวทั้งหมด</div></a>
			</span>			
		</div>
		<?php endif;?>
		<!--ข่าวเอเชี่ยน-->
		<?php if(!empty($dataNewsAsian)):?>
		<div class="news_block_style3 floatLeft">
			<div class="header"><span>ข่าวเอเชี่ยน</span></div>
			<a href="<?php echo base_url().'archives/'.$dataNewsAsian->news_id.'-'.seo_url($dataNewsAsian->news_subject);?>" target="_blank">
				<h2><?php echo $dataNewsAsian->news_subject;?></h2>
				<div class="image">
					<?php echo exec_image(array(
							'folder' => 'news',
							'dimension' => '315x190',
							'file_name' => @$dataNewsAsian->image->news_file_name.'.'.@$dataNewsAsian->image->news_file_ext,
							'alt' => ''.@$dataNewsAsian->news_subject.'',	
							'title' => ''.@$dataNewsAsian->news_subject.''	
						)
					);?>			
				</div>
			</a>
			<p><?php echo $dataNewsAsian->news_brief;?></p>
			<span class="post">
				<?php echo date('d.m.Y',strtotime($dataNewsAsian->news_publish_date));?><span class="grayLight"> l </span><?php echo number_format($dataNewsAsian->views);?> VIEWS
				<a href="<?php echo base_url().'asian';?>" class="readMoreNews"><div>อ่านข่าวทั้งหมด</div></a>
			</span>			
		</div>
		<?php endif;?>
		<!--ข่าววงการหนัง-->
		<?php if(!empty($dataNewsMovie)):?>
		<div class="news_block_style3 floatRight">
			<div class="header"><span>ข่าววงการหนัง</span></div>
			<a href="<?php echo base_url().'archives/'.$dataNewsMovie->news_id.'-'.seo_url($dataNewsMovie->news_subject);?>" target="_blank">
				<h2><?php echo $dataNewsMovie->news_subject;?></h2>
				<div class="image">
					<?php echo exec_image(array(
							'folder' => 'news',
							'dimension' => '315x190',
							'file_name' => @$dataNewsMovie->image->news_file_name.'.'.@$dataNewsMovie->image->news_file_ext,
							'alt' => ''.@$dataNewsMovie->news_subject.'',	
							'title' => ''.@$dataNewsMovie->news_subject.''	
						)
					);?>			
				</div>
			</a>
			<p><?php echo $dataNewsMovie->news_brief;?></p>
			<span class="post">
				<?php echo date('d.m.Y',strtotime($dataNewsMovie->news_publish_date));?><span class="grayLight"> l </span><?php echo number_format($dataNewsMovie->views);?> VIEWS
				<a href="<?php echo base_url().'movie';?>" class="readMoreNews"><div>อ่านข่าวทั้งหมด</div></a>
			</span>			
		</div>
		<?php endif;?>					
	</div>
</div>
<div id="right_side">
	<!--Module-->
	<?php
	if(!empty($module))
	foreach($module as $value):?>
	<?php echo $value;?>
	<?php endforeach;?>
</div>
<div class="clear">
</div>
<script type="text/javascript" language="javascript">
(function($) {
/*whatever jQuery stuff*/
	$(function(){
		//multipleElementsCycle
		$("#slider").multipleElementsCycle({
			scrollCount: 4,
			start: 0,
			jumpTo: '.cycleToPoint'
		});
			
		/* Auto Slide Hilight by ONIPHP*/
		var autoCycleHilight = null;
		var hilight_index = 1;
		var hilight_total = $('#news_hilight a[class*="hilight_id_"]').length;
		var hilight_timeout = 5000;
		autoCycleHilight = setInterval(function() {
			// Do stuff here
			autoSlideHilight();					
		},hilight_timeout);	
		
		$('#news_hilight a[class*="hilight_id_"]').each(function(){
			$(this).click(function(){
				hilight_index = $(this).parent().index();			
			});
		});
		
		$('#news_hilight').hover(function() {
			clearInterval(autoCycleHilight);    
		}, function() {
			autoCycleHilight = setInterval(function(){ 
				// Do stuff here
				autoSlideHilight();					
			},hilight_timeout);
		});
		
		var autoSlideHilight = function()
		{
			// Do stuff here
			var ele = $('#news_hilight a[class*="hilight_id_"]').eq(hilight_index);
			var hilight_id = ele.attr('class');
			var class_show = $('#news_hilight').find('div[class*="hilight_id_"]:visible:lt(5)').attr('class');
			var on_show = $('#news_hilight').find('li a[class="'+class_show+'"]');
			$('#news_hilight').find('div[class*="hilight_id_"]:lt(5)').hide();
			$('#news_hilight').find('div[class="'+hilight_id+'"]').fadeIn('fast');
			/*Swap Content*/
			ele.replaceWith(on_show.css({'display':'block'}).clone());
			$(on_show).replaceWith(ele.css({'display':'none'}).clone());
			hilight_index = hilight_index + 1;
			if(hilight_index >= hilight_total) hilight_index = 1;					
		}
		/* End Auto Slide Hilight by ONIPHP*/		
	});	
})(jQuery);
</script>